package com.vhall.component.controller.preparation;

import com.vhall.component.entity.preparation.dto.AdmWatermarkListDTO;
import com.vhall.component.entity.preparation.vo.WatermarkListVO;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.service.preparation.AdmWatermarkService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 水印管理-控制台
 *
 * @author xing.wang
 * @date 2022/10/31
 */
@RestController
@RequiredArgsConstructor
@Slf4j
@RequestMapping("/v4/watermark/console")
public class ClsWatermarkController {
    private final AdmWatermarkService watermarkService;

    /**
     * 水印模板管理获取列表
     *
     * @param vo 参数
     * @return PageVO<AdmWatermarkListDTO>
     */
    @GetMapping("/list")
    @TokenAuth
    public List<AdmWatermarkListDTO> list(@Validated WatermarkListVO vo) {
        return watermarkService.getWatermarkList(vo);
    }
}
